package com.imooc.sell.dataobject;

import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Proxy;
import org.springframework.stereotype.Component;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Date;

//把数据库映射成对象
@Entity
//时间自动更新
@DynamicUpdate
@Data
public class ProductCategory {
  /*
   * 类目id 是自增的 ，是主键
   * */
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Integer categoryId;
  /*
   * 类目编号
   * */
  private Integer categoryType;
  /*
   * 类目名称
   * */
  private String categoryName;

  private Date createTime;

  private Date updateTime;

  /**
   * 空参构造
   */
  public ProductCategory() {

  }

  /**
   * @param categoryType
   * @param categoryName
   */
  public ProductCategory(Integer categoryType, String categoryName) {
    this.categoryType = categoryType;
    this.categoryName = categoryName;
  }
}
